<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="UTF-8">
    <title>个人管理中心</title>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <link href="../static/css/usermanage.css" th:href="@{/css/usermanage.css}" rel="stylesheet" type="text/css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <link rel="shortcut icon" href="../static/img/logo.png" th:href="@{/img/logo.png}" type="image/x-icon"/>

</head>
<body>
<div class="pre-header">
    <a href="index.html">返回首页</a>
</div>
<div class="container">
    <div class="row">
        <!--左边栏-->
        <div class="col-xs-2 usermanagepart">
            <div class="box">
                <div class="title">目录</div>
                <div class="directory">
                    <div class="item"><a href="#section-1">基本信息</a></div>
                    <div class="item"><a href="#section-2">工作信息</a></div>
                    <!--                          <div class="item"><a href="#section-3">病因</a></div>-->

                </div>
            </div>
        </div>
        <!--右侧-->
        <div class="col-xs-9">
<!--            头像简要信息-->
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="col-xs-2" data-toggle="modal" data-target="#myModal4">
                        <img src="../static/img/login/male.png" th:src="@{${userinfo.getImg()}}" alt="kongpzi"
                             class="img-circle useravator">
                    </div>
                    <div class="col-xs-9">
                        <div class="parent" style="margin-top: 1px">
                            <span th:text="${userinfo.getName()}">冯绍泽</span>
                            <span class="label label-warning label-xs child" id="level"
                                  th:text="${userinfo.getLevel()}">等级1</span>
                        </div>
                        <div class="child" id="description" th:text="${userinfo.getDescription()}" th:maxlength="64">
                            甲子云。云世界
                        </div>
                    </div>
                </div>
            </div>
<!--            基本信息-->
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="level1" id="section-1">
                        <div class="col-xs-9" style="margin-top: 5px">基本信息</div>
                        <button type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#myModal1"
                                onclick="toupdateuserinfo()">
                            <span class="glyphicon glyphicon-pencil"></span> 修改基本信息
                        </button>
                        <!--                                  <input type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal1" value="修改信息">-->
                    </div>
                    <hr>
                    <!--                    个人信息显示-->
                    <div id="infor1">
                        <form class="form-horizontal">
                            <div class="form-group">
                                <label for="name" class="col-sm-2 control-label">昵称</label>
                                <div class="col-sm-10 info1div" id="name" th:text="${userinfo.getName()}">冯邵则
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="age" class="col-sm-2 control-label">年龄</label>
                                <div class="col-sm-10 info1div" id="age" th:text="${userinfo.getAge()}">88
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="address" class="col-sm-2 control-label">地址</label>
                                <div class="col-sm-10 info1div" id="address" style="width: 60%"
                                     th:text="${userinfo.getAddress()}">上海-浦东-机密村
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="address" class="col-sm-2 control-label">邮箱</label>
                                <div class="col-sm-10 info1div" id="email" th:text="${userinfo.getEmail()}">
                                    888888@888.com
                                </div>
                            </div>
                            <div class="form-group" th:if="${userinfo.getSex() != null}">
                                <label for="address" class="col-sm-2 control-label">性别</label>
                                <div class="col-sm-10 info1div" id="sex" th:text="${userinfo.getSex() == 1}?'女':'男'">女
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="address" class="col-sm-2 control-label">注册</label>
                                <div class="col-sm-10 info1div" th:text="${userinfo.getRegisterdate()}">1990-12-12
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="address" class="col-sm-2 control-label">描述</label>
                                <div class="col-sm-10 info1div"  th:text="${userinfo.getDescription()}">甲子云 云世界。
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
<!--            医师信息-->
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="level1" id="section-2">
                        <div class="col-xs-2" style="margin-top: 5px">工作信息</div>
                        <div class="col-xs-7">
                            <button th:if="${userinfo.getType()!=2}" type="button" class="btn btn-info btn-sm"
                                    data-toggle="modal"
                                    data-target="#myModal2">
                                <span class="glyphicon glyphicon-pencil"></span> 医生认证
                            </button>
                        </div>
                        <button th:if="${userinfo.getType()==2}" type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#myModal3"
                                onclick="tocertificModal()">
                            <span class="glyphicon glyphicon-pencil"></span> 修改工作信息
                        </button>
                        <!--                                  <input type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal2" value="修改信息">-->
                    </div>
                    <hr>
                    <div id="infor2">
                        <div th:if="${userinfo.getType()==3}" style="margin-left: 10px">
                            <span class="label label-danger">认证失败，请重新审核</span>
                        </div>
                        <div th:if="${userinfo.getType()==4}" style="margin-left: 10px">
                            <span class="label label-success">认证审核中...</span>
                        </div>

                        <div th:if="${userinfo.getType()==2}">
                            <form class="form-horizontal">
                                <div class="form-group">
                                    <label for="name" class="col-sm-2 control-label">QQ号</label>
                                    <div class="col-sm-10 info1div" id="QQ2" th:text="${doctor.getPhone()}">151515
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="age" class="col-sm-2 control-label">工作地址</label>
                                    <div class="col-sm-10 info1div" id="d_address2" style="width: 60%"
                                         th:text="${doctor.getWorkplace()}">江苏省南京市第一人民y院
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="address" class="col-sm-2 control-label">治疗方向</label>
                                    <div class="col-sm-10 info1div" id="dons2"th:each="diseasetag:${diseasetags}" th:if="${diseasetag.getId()}==${selectdiseasetagid}"
                                         th:text="${diseasetag.getName()}">fanxiang
                                    </div>
                                </div>
                            </form>

                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!--modal个人信息修改-->
        <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
             aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content col-md-8">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">修改个人信息</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal ">
                            <div class="form-group"style="display: none">
                                <label for="name" class="col-sm-2 control-label"></label>
                                <div class="col-sm-10">
                                    <input type="hidden" class="form-control" th:value="${userinfo.getId()}" id="rid"
                                           name="rid">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="name" class="col-sm-2 control-label">昵称</label>
                                <div class="col-sm-10">
                                    <input type="email" class="form-control" th:value="${userinfo.getName()}" id="rname" placeholder="请输入昵称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="age" class="col-sm-2 control-label">年龄</label>
                                <div class="col-sm-10">
                                    <input type="number" class="form-control" th:value="${userinfo.getAge()}" id="rage" placeholder="请输入年龄">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="address" class="col-sm-2 control-label">地址</label>
                                <div class="col-sm-10" style="left: -15px">
                                    <div class="col-md-3">
                                        <select style="margin-bottom:15px;" class="form-control" id="rprovince"
                                                name="address" onchange="rprovincechage()">
                                            <option value="none">----请选择----</option>
                                        </select>
                                    </div>
                                    <div class="col-md-3">
                                        <select class="form-control" id="rcity" name="address">
                                            <option value="none">----请选择----</option>
                                        </select>
                                    </div>
                                    <div class="col-md-6"><input type="text" class="form-control" id="rdetailaddress"
                                                                 name="address"
                                                                 placeholder="请输入地址"></div>

                                </div>
                            </div>
                            <div class="form-group">
                                <label for="email" class="col-sm-2 control-label">邮箱</label>
                                <div class="col-sm-10">
                                    <input type="email" class="form-control" th:value="${userinfo.getEmail()}" id="remail" name="email"
                                           placeholder="请输入邮箱">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label">性别</label>
                                <div class="col-md-5">
                                    <div class="radio-inline">
                                        <input type="radio" name="sex" id="sex-man" value="man" th:checked="${userinfo.getSex()==2}?true:false" />男
                                    </div>
                                    <div class="radio-inline">
                                        <input type="radio" name="sex" id="sex-woman" value="woman" th:checked="${userinfo.getSex()==1}?true:false"/>女
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label">描述</label>
                                <div class="col-sm-10">
                                    <textarea maxlength="30" style="width: 100%" th:text="${userinfo.getDescription()}" id="rdescription" placeholder="输入不超过30字符"></textarea>
                                </div>
                            </div>
                            <br/>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <input type="button" id="in_inform" style="width: 100%;opacity: 0.8" value="提交"
                                           class="btn btn-primary btn-sm" onclick="updateuserinfo()">
                                </div>
                            </div>
                        </form>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal -->
        </div>
        <!--modal医师认证申请-->
        <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
             aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content ">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">认证信息</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal doctorform1">
                            <div class="form-group">
                                <label for="name" class="col-sm-2 control-label">手机号</label>
                                <div class="col-sm-10">
                                    <input type="tel" class="form-control" id="d_phone" placeholder="请输入手机号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="address" class="col-sm-2 control-label">工作地址</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="d_address" placeholder="请输入地址">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="email" class="col-sm-2 control-label">证件图片</label>
                                <div class="col-sm-10">
                                    <input type="file" class="form-control" id="d_imgfile"
                                           accept="image/gif, image/jpeg"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="address" class="col-sm-2 control-label">治疗方向</label>
                                <div class="col-sm-10">
                                    <select style="margin-bottom:15px;" class="form-control" id="d_disease">
                                        <option value="0">----请选择----</option>
                                        <option th:each="diseasetag:${diseasetags}" th:value="${diseasetag.getId()}">[[${diseasetag.getName()}]]</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <input type="button" id="identify" value="提交" class="btn btn-primary btn-sm" onclick="applyDoctor()">
                                </div>
                            </div>
                        </form>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal -->
        </div>
        <!--modal已认证医师信息修改-->
        <div class="modal fade" id="myModal3" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
             aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">认证信息修改</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal doctorform1">
                            <div class="form-group">
                                <label for="name" class="col-sm-2 control-label">手机号</label>
                                <div class="col-sm-10">
                                    <input type="tel" class="form-control" id="rd_phone" th:value="${doctor.getPhone()}" placeholder="请输入手机号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="address" class="col-sm-2 control-label">工作地址</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="rd_address" th:value="${doctor.getWorkplace()}" placeholder="请输入地址">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="address" class="col-sm-2 control-label">治疗方向</label>
                                <div class="col-sm-10">
                                    <select style="margin-bottom:15px;" class="form-control" id="rd_disease">
                                        <option th:each="diseasetag:${diseasetags}" th:value="${diseasetag.getId()}" th:if="${diseasetag.getId()}==${selectdiseasetagid}?'checked':''">[[${diseasetag.getName()}]]</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <input type="button" id="sum" value="提交" class="btn btn-primary btn-sm" onclick="updateDoctor()">
                                </div>
                            </div>
                        </form>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal -->
        </div>
        <!-- 头像-->
        <div class="modal fade" id="myModal4" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
             aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">头像信息</h4>
                    </div>
                    <div class="modal-body">
                        <div class="avator">
                            <img src="../static/img/login/male.png" th:src="@{${userinfo.getImg()}}" alt="kongpzi"
                                 class="img-circle">
                            <form id="uploadAvatorForm" name="uploadForm" enctype="multipart/form-data">
                                <div class="avatortip" id="avatortip"> 更换成功，页面即将跳转</div>
                                <input type="file" id="avatorfile" name="avatorfile" accept="image/*"/>
                                <input class="btn btn-primary btn-sm" id="avatorbtn" value="上传"
                                       onclick="uploadAvator()">
                            </form>
                        </div>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal -->
        </div>
    </div>
</div>
</body>
<script src="../static/js/usermanage.js" th:src="@{/js/usermanage.js}"></script>

</html>
